package com.spring.housing.config;


import com.spring.housing.interception.MvcInterception;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class InterceptionConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(interception()).addPathPatterns("/**").excludePathPatterns("/login/index").excludePathPatterns("/register/index");
    }

    @Bean
   public MvcInterception interception(){
        return  new MvcInterception();
    }


}
